|
![](/i/fill.gif) |
Hi!
I've been tryin to make somethign resembling an onion an cutting it away. Not
that I want it to look as an onion, just a bunch of concentric spheres. I
wanted to use the #while loop so that I wouldn't need to type much and could
change stuff easily. But only the first iteration seems to run OK, then it gets
weird. Could you please llok at my code, run it and help? Thanks!
Matija
#include "colors.inc"
#include "glass.inc"
#include "skies.inc"
#include "textures.inc"
background{White}
camera {
angle 15
location <3,12,10>
look_at <0,0,0>
}
light_source { <12, 5, 3> color White }
#declare Stevec=1;
#declare Rad1 = 1;
#declare Rad2 = 0.1;
#declare Onion =
#while (Stevec >= 0.2)
#declare Rad1=Stevec;
#declare Rad2=Rad1-0.1;
difference {
sphere {<0,0,0>, Rad1}
sphere {<0,0,0>, Rad2 hollow} cutaway_textures}
#declare Stevec=Stevec-0.2;
#end
intersection {
object {Onion pigment {color Green}}
box {<0,-1,-1>
<-1,1,1>
pigment {color Blue}}
}
Post a reply to this message
|
![](/i/fill.gif) |